<?php
    function flash_message( $id, $message, $flag = false ){
        $CI = & get_instance();
        if( $flag == 1 ){
            $message = '<div class="alert alert-success alert-dismissable" style="margin-left: 0px;">
                            <i class="fa fa-check"></i>
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            ' . $message . '</div>';
        }else{
            $message = '<div class="alert alert-danger alert-dismissable" style="margin-left: 0px;">
                           <i class="fa fa-ban"></i>
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            ' . $message . '</div>';
        }
        $CI->session->set_flashdata($id, $message);
    }
?>